﻿@inherits Project.Engine.Control.BasePageRazor
@{
    ViewBag.Title = "Trang Chủ";
    Layout = "~/Views/Home/_Master.cshtml";
    Project.Module.View.Catagory cate = this.Model.DocumentObject as Project.Module.View.Catagory;
}
@{ViewBag.Title = @cate.cateName;}
<div id="noidung">
    <h1>@cate.cateName</h1>
    @{
        if (cate.listProduct != null && cate.listProduct.ToList().Count > 0)
        {
            foreach (var item in cate.listProduct)
            {
        <div class="node">
            <a href="/nguyen-lieu-lam-banh?id=@item.ProductId?@item.url"><h3>@item.ProductName</h3></a>
            <h4>@{
                string status = "Chưa sẵn sàng";
                if(@item.ProductStatus == true){
                    status = "Sẵn sàng";   
                }}
                @status
            </h4>
            <a href="/nguyen-lieu-lam-banh?id=@item.ProductId?@item.url"><img src="@item.ImagePath" alt="" /></a>
            <h3>@item.priceProduct VNĐ</h3>
            @if (status.Contains("Sẵn sàng") == true){
                <a href="/gio-hang?name=@cate.displayuser?add=@item.ProductId" class="button">Mua hàng</a>
            } else {
                <a href="#" class="button">Chưa được giao dịch</a>
            }
        </div>
    <!--end .node-->
            }
            
            <div class="trang">
            @if (cate.totalRecord > cate.pageSize)
            {
                Html.RenderPartial("~/views/shared/paging.cshtml", new { TotalRecord = cate.totalRecord, CPage = cate.pageIndex, PageSize = cate.pageSize, CateId = cate.NodeID });
            }
            </div>
        }
    }
</div>
<!--end #noidung-->


